
const Counter = {
    data() {
        return {
            myHB: '',
            obj: {
                name: 'name'
            },
            counter: "aa",
            message: "",
            studentslist: [{name: "张三", sno: 1, index: 0}, 
                {name: "李四", sno: 2, index: 1},
                {name: "王五", sno: 3, index: 2},
                {name: "赵六", sno: 4, index: 3}
            ]
        }
    },
    created() {
        console.log("created")
    },
    beforeCreate() {
        console.log("beforeCreate")
    },
    // mounted() {
    //     console.log(mounted)
    // },
    beforeUpdate() {
        console.log(beforeUpdate)
    },
    updated() {
        console.log(updated)
    },
    methods: {
        click() {
            alert("a")
        }
    },
}

let App = Vue.createApp(Counter);
// 注册一个全局自定义指令 `v-focus`
App.directive('focus', {
    // 当被绑定的元素插入到 DOM 中时……
    mounted(el, delivered) {
      // 聚焦元素
      console.log(delivered)
      el.value = delivered.value
      console.log(el.value)
      el.focus()
    }
})
App.mount('#counter')
